﻿@model IEnumerable<MobilesStore.Domain.Entities.Product>

@{
    ViewBag.Title = "Admin: All Products";
    Layout = "~/Views/Shared/_MainLayout.cshtml";
}
<div id="column-left">
        <div class="box">
          <div class="box-heading">Information</div>
          <div class="box-content">
            <ul class="list-item">
              <li>@Html.ActionLink("About Us","About")</li>
              <li><a href="#">Delivery Information</a></li>
              <li><a href="#">Privacy Policy</a></li>
              <li><a href="#">Terms &amp; Conditions</a></li>
              <li>@Html.ActionLink("Contact Us","Contact")</li>
              <li><a href="#">Site Map</a></li>
            </ul>
          </div>
        </div>
        <div class="box">
          <div class="box-heading">Bestsellers</div>
          <div class="box-content">
            <div class="box-product">
              <div class="flexslider">
                @{Html.RenderAction("BestSellerProductsSmall", "Nav");}
              </div>
            </div>
          </div>
        </div>
      </div>
      <!--Left End-->
      <!--Middle Part Start-->
      <div id="content">
        <!--Breadcrumb Part Start-->
        <div class="breadcrumb">@Html.ActionLink("Home","Index","Home") » @Html.ActionLink("Admin","Index","Admin")</div>
        <!--Breadcrumb Part End-->
        <h1>All Products</h1>

            <table class="Grid">
                <tr>
                    <th>ID</th> 
                    <th>Name</th> 
                    <th class="NumericCol">Price</th> 
                    <th>Actions</th>
                </tr>

            @foreach (var item in Model) {
                <tr>
                    <td>@item.ProductID</td> 
                    <td><strong>@Html.ActionLink(item.ProductName, "Edit", new { item.ProductID })</strong></td> 
                    <td class="NumericCol">@item.ProductPrice.ToString("c")</td> 
                    <td> 
                        @using (Html.BeginForm("Delete", "Admin")) { 
                            @Html.Hidden("ProductID", item.ProductID)
                            <input type="submit" value="Delete" class="button"/> 
                        } 
                    </td>
                </tr>
            }

            </table>
            <p>@Html.ActionLink("Add a new product", "Create", null, new { @class="button"})</p>
      </div>
      <!--Middle Part End-->
